home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / OTHERCST / MISC_ROU / DEFAULTO.C < prev    next >
C/C++ Source or Header  |  1990-07-16  |  656b  |  28 lines

  1. #include <quickdraw.h>
  2.  
  3. /*
  4. **    DefaultOK
  5. **    This next little piece of code puts the default heavy rounded
  6. **    box around the "OK" button of a dialog, so the user knows that 
  7. **    pressing return is the same as hitting "OK"
  8. */
  9. void
  10. DefaultOK(theDialog)
  11. DialogPtr    theDialog;
  12. {
  13.     int itemType;
  14.     Handle itemHdl;
  15.     Rect itemRect;
  16.     GrafPort    savedPort;
  17.     PenState    savedPen;
  18.     
  19.     GetPort(&savedPort);
  20.     GetPenState(&savedPen);
  21.     SetPort(theDialog);        /* without this, can't highlite OK */
  22.     GetDItem(theDialog, 1, &itemType, &itemHdl, &itemRect);
  23.     PenSize(3,3);
  24.     InsetRect(&itemRect, -4, -4);
  25.     FrameRoundRect(&itemRect, 16, 16);
  26.     SetPenState(&savedPen);
  27.     SetPort(&savedPort);
  28. }